<%@page import="com.sinodata.bsm.center.cache.PropertyValueCache"%>
<%@page import="com.sinodata.bsm.center.bean.ResBean"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.sinodata.bsm.center.util.spring.SpringContextHolder"%>
<%@page import="com.sinodata.bsm.center.service.resource.ResService"%>
<%@page import="com.sinodata.bsm.center.service.config.PortalService"%>
<%@ page import="com.sinodata.bsm.common.vo.*"%>
<%@ page import="com.sinodata.bsm.common.utils.*"%>
<%@ page import="com.sinodata.bsm.center.bean.*"%>
<%@page import="com.sinodata.bsm.common.constants.ResConstants"%>
<%@ include file="../include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%
    String pageno = request.getParameter("pageno");
if(pageno==null)pageno="1";
	List<Res> resList =(List)request.getAttribute("resList");
	Map<Long,String> fusionMap = (Map)request.getAttribute("fusionMap");
	String resBaseChart=(String)request.getAttribute("resBaseChart");
	int usedCount=0;
	int unusedCount=0;
%>
<link type="text/css" rel="stylesheet" href="/bsm/style/default/bsm/appview.css" />
<script type="text/javascript">
function initTop(){
	try{
	$("#useability_div").jCarouselLite({
    		btnNext: "#next",
    		btnPrev: "#prev",
    		visible: 4
    		
		});
	}catch(e){
	
	}
		var myChart = new FusionCharts("${pageContext.request.contextPath}/resources/charts/AngularGauge.swf","myChartId1", 125, 82, "0", "1");
		myChart.setJSONData(<%=resBaseChart%> );
		myChart.render("yibiao");
		try{
		<%for(int i = 0;i<resList.size();i++){
		    Res r = resList.get(i);
		%>
			 var chengglChart = new FusionCharts("${pageContext.request.contextPath}/resources/charts/Column2D.swf","myChartId<%=r.getId()%>", 179, 103, "0", "1");

			 chengglChart.setJSONData(<%=fusionMap.get(r.getId())%>);
			 chengglChart.render("chenggl_<%=r.getId()%>");
		<%}%>
		}catch(e){
			}
}

</script>
<!--手机银行系统监控一览-->
<!--监控一览-->
<div class="column">
	<b class="b1"></b>
	<b class="b2"></b>
	<b class="b3"></b>
	<b class="b4"></b>
	<div class="content" style="height:158px;">
		<h2>${res.name }一览</h2>
		<ul class="x-ul">
			<li class="w-35">
				<!--健康状况-->
				<div class="jiankang">
					<h3>
						健康状况
					</h3>
					<div class="jiankang_content" id="yibiao"></div>
					<div class="jiankang_text">
						<span>当前健康状况：</span><span style="color:blue;">
						    ${healthStatus}
						</span>
					</div>
				</div>
				<!--@end 健康状况-->

				<!--可用性统计-->
				<div class="availability">
					<h3>
						<a href="viewanalyze-available-all.jsp?resid=${res.id }" target="_blank">可用性统计</a>
					</h3>
					<div class="kyx_content m20">
					      <div class="kyx_content_left">
					        <a class="kyx_content_Pellet">					
					        <img src="/bsm/style/default/bsm/appview/Pellet6.png" width="45" height="45"/><span>60%						  
					        </span></a>
					      </div>
					      <div class="kyx_content_right">
						  <a class="kyx_content_top"><img src="/bsm/style/default/bsm/appview/bky.png" width="16" height="16"/><span class="red">3</span></a>
						  <a class="kyx_content_bottom"><img src="/bsm/style/default/bsm/appview/ky.png" width="16" height="16"/><span class="green">9</span></a>									
						  </div>
						 </div>
						 <div class="availability_text" style="margin-top:5px;">
						   <span>当前状态：</span><span style="color:blue;">可用</span>
					     </div>
				</div>
				<!--@end 可用性统计-->
					
			</li>
			<li>
				<img id="prev" style="float: left; margin: 16px 2px 0px 0px;"
					src="/bsm/style/default/bsm/appview/prev.png" />
			</li>
			<li class="w-65">
				<!--wap  iphone  andriod 登录-->
				<div class="left_ul" id="useability_div" style="position: relative;">
					<ul>
					 <c:forEach var="itemres" items="${resList}">
						<li>
							<h3>
								<a
									href="${pageContext.request.contextPath}/resource/res-query!view.action?id=${itemres.id }&pId=0&viewId=1&ntype=2"
									style="cursor: pointer; color: #091782;" target="_blank">${itemres.name }</a>
							</h3>
							 <div id="chenggl_${itemres.id}"></div>
						</li>
					</c:forEach>
					</ul>

				</div>
			</li>
			<li>
				<img id="next" style="float: left; margin: 16px 0px 0px -5px;"
					src="/bsm/style/default/bsm/appview/next.png" />
			</li>
		</ul>


		<!--@end wap iphone andriod 登录-->
		<br class="clear" />
	</div>
</div>
        <jsp:include page="viewdetailstate.jsp">
             <jsp:param name="resid" value="${res.id }"/>
            <jsp:param name="pageno" value="1" ></jsp:param>
         </jsp:include>
<!--@end 手机银行系统监控一览-->
<div class="column">
	<div class="tabbar">
		<ul>
			<li id="baseLi" class="<%=pageno.equals("1") ? "selected":"" %>">
				<a id="baseA" href="viewdetail1.jsp?resid=${res.id }"
					target="_self"><span>基础资源</span>
				</a>
			</li>
			<li id="appViewLi" class="<%=pageno.equals("2") ? "selected":"" %>">
				<a id="appViewA" href="viewdetail2.jsp?resid=${res.id }"
					target="_self"><span>应用环境</span>
				</a>
			</li>
			<li id="appRelLi" class="<%=pageno.equals("3") ? "selected":"" %>">
				<a id="appRelA" href="viewdetail3.jsp?resid=${res.id }"
					target="_self"><span>应用关联</span>
				</a>
			</li>
			<li id="eventLi" class="<%=pageno.equals("4") ? "selected":"" %>">
				<a id="eventA" href="viewdetail4.jsp?resid=${res.id }"
					target="_self"> <span>事件分析</span>
				</a>
			</li>
		</ul>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript">
<!--
$("#usedCount_span").html('<%=usedCount%>');
$("#unusedCount_span").html('<%=unusedCount%>');
//-->
</script>
